<?php

namespace App\Services\SetUserPayCode;

use App\Models\User;

class SetUserPayCode
{
	/**
	 * @var User
	 */
	protected $user;
	
	protected $payCode;
	
	public function __construct(User $user, string $payCode)
	{
		$this->user = $user;
		$this->payCode = $payCode;
	}
	
	public function set()
	{
		$this->user->update(['pay_code' => bcrypt($this->payCode)]);
	}
}
